import request from '@/config/axios'

// 职工职称 VO
export interface EmployeeTitlesVO {
  id: number // 主键ID
  empId: number // 职工ID
  tieId: number // 职称
  cmpFlag: string // 计薪标记: 0-非计薪, 1-计薪
}

// 职工职称 API
export const EmployeeTitlesApi = {
  // 查询职工职称分页
  getEmployeeTitlesPage: async (params: any) => {
    return await request.get({ url: `/pm/employee-titles/page`, params })
  },

  // 查询职工职称详情
  getEmployeeTitles: async (id: number) => {
    return await request.get({ url: `/pm/employee-titles/get?id=` + id })
  },

  // 新增职工职称
  createEmployeeTitles: async (data: EmployeeTitlesVO) => {
    return await request.post({ url: `/pm/employee-titles/create`, data })
  },

  // 修改职工职称
  updateEmployeeTitles: async (data: EmployeeTitlesVO) => {
    return await request.put({ url: `/pm/employee-titles/update`, data })
  },

  // 删除职工职称
  deleteEmployeeTitles: async (id: number) => {
    return await request.delete({ url: `/pm/employee-titles/delete?id=` + id })
  },

  // 导出职工职称 Excel
  exportEmployeeTitles: async (params) => {
    return await request.download({ url: `/pm/employee-titles/export-excel`, params })
  },
}